'''============================
@Time : 2024/1/19 12:24
@Author : YangLiHua
@File : conftest.py
@Desc : 
============================'''
import pytest
from selenium import webdriver
from selenium.webdriver.edge.service import Service
from config.config import url,driver_path

@pytest.fixture(scope='session')
def login():
    e = Service(executable_path=driver_path)
    # 通过浏览器驱动打开浏览器
    driver = webdriver.Edge(service=e)
    # 浏览器最大化
    driver.maximize_window()
    # 登录禅道
    driver.get(url)
    # 此时driver作为返回值
    yield driver
    driver.quit()